#ifndef COURSE_H
#define COURSE_H

#include <string>
#include <iostream>
#include <sstream>
using namespace std;

class Course {
private:
    string courseId;  // Course ID
    string courseName;  // Course name
    string courseNature;  // Nature (elective/mandatory)
    string sort;  // Discipline
    string classTime;  // Class schedule
    int totalHours;  // Total hours (calculated from class schedule)
    int teachingHours;  // Teaching hours (total hours - lab hours)
    int labHours;  // Lab hours or practical hours
    float credit;  // Credits
    int semester;  // Semester offered

public:
    static int CourseCnt;

	Course() = default;
    ~Course() = default;
    // Constructor
    Course(string name, string nature, string disc, string time, int lab, float cred, int sem);
    
    // Copy constructor
    Course(const Course& other);
    
    // Assignment operator overloading
    Course& operator=(const Course& other);

    // Get course information (as a string)
    string toString() const;

    // Get course nature
    string getCourseNature() const {
		return courseNature; 
	};

	// Get course ID
	string getCourseId() const {
    	return courseId;
	}

	// Modify course credits
	void addCredit(float extra) {
    	credit += extra;
	}

	// Get course credits
	float getCredit() const {
    	return credit;
	}
    
    // Friend classes
    friend class CourseLib;
    friend class Student;

private:
    int calculateTotalHours(const string& time) const; // Calculate total hours based on classTime
};

#endif

